package company.wangyi_F;

import java.util.Scanner;

// 半个小时一道题需要思路很清晰，否则时间不够的
public class Wang2A {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] array = new int[m];
        int[] used = new int[n];
        for (int i = 0; i < m; i++) {
            array[i] = sc.nextInt();
            used[array[i] - 1] = 1;
        }
        System.out.println(getMinString(array, n, m));
    }

    private static String getMinString(int[] array, int n, int m) {
        StringBuilder sb = new StringBuilder();
        int i = 1;
        for (int j = 0; j < m; j++) {
            for (; i <= array[j]; i++) {
                sb.append(i).append(" ");
            }
        }
        for (; i <= n; i++) {
            sb.append(i).append(" ");
        }
        return sb.toString();
    }
}
